package edu.sctu.practice.class02.xuejiahua.assign03.ass02;

/**
 * Created by Administrator on 2015/10/29.
 */
public class ComparableCylinder extends Cylinder implements Comparable{

    public int area ;

    public ComparableCylinder(int r, int h) {
        super(r, h);
    }

    @Override
    public int compareTo(Object o) {
        area = (int) (2*Math.PI*r*r+h*(2*Math.PI*r));
        System.out.println("圆柱面积："+area);
        return area;
    }
}
